package test;


import javax.naming.InitialContext;

import org.junit.Test;

import cn.model.User;
import cn.userBean.UserManager;

public class test {

	public UserManager getUserManager() throws Exception{
		InitialContext ctx = new InitialContext();
		UserManager userManager = (UserManager) ctx
				.lookup("UserManagerBean/remote");
		return userManager;
	}
	
	@Test
	public void testAdd() throws Exception {
		InitialContext ctx = new InitialContext();
		UserManager userManager = (UserManager) ctx
				.lookup("UserManagerBean/remote");
		User user = new User();
		user.setSex("0");
		user.setUserName("dfdfgfd");
		user.setPassword("fdgfd");
//		user.setBirthDay(new Date());
		int a = userManager.addUser(user);
		System.out.println(a);
	}	
}
